package comits.web.client.servlets.demo;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


public class ScannerProduitServlet extends HttpServlet{
        
        /**
         * 
         * @author Ludmilla
         */
        private static final long serialVersionUID = 7526928611471348888L;

        protected void processRequest(HttpServletRequest request,
                        HttpServletResponse response) throws ServletException, IOException {
                doGet(request, response);
        }
        
        protected void doGet(HttpServletRequest request,
                        HttpServletResponse response) throws ServletException, IOException {
                String action = request.getParameter("action");
                
                if(action.equals("OK")){                      
                        getServletContext().getRequestDispatcher("/scannerProduit.jsp").forward(request, response);
                        
                } else if(action.equals("Valider")){                        
                        getServletContext().getRequestDispatcher("/?.jsp").forward(request, response);                           
                } 
        }
        
        /**
         * Returns a short description of the servlet.
         * 
         * @return a String containing servlet description
         */
        public String getServletInfo() {
                return "Short description";
        }// </editor-fold>
        
}